import Datastore from 'nedb'
import {config} from '../utils'

const softconfig = config.get('softconfig')

export const db = {
  open(name) {
    return new Datastore({
      filename: `${softconfig.data_ptah}${name}.db`,
      autoload: true,
      timestampData: true
    })
  }
}
